<template>
	<view class="flex-col page">
		<u-list @scrolltolower="getmore">
			<u-list-item v-for="(item, index) in list" :key="index">
				<view class="top-section flex-col">
					<text class="text_6">时间：{{item.createtime|getdays}}</text>
					<text class="text_8">金额：{{item.amount}}</text>
					<view class="bottom-group">
						<text class="text_10">状态：</text>
						<text class="text_12">{{item.status?'已完成':'未审核'}}</text>
					</view>
				</view>
			</u-list-item>
			<u-gap height="80" bgColor="#fff" marginTop="10" marginBottom="10"></u-gap>
		</u-list>
	</view>
</template>

<script>
	import moment from 'moment'
	import {
		withdrawlist
	} from '../../config/api.js'
	export default {
		data() {
			return {
				page: 1,
				list: []
			};
		},
		mounted() {
			this.getdata()
		},
		filters: {
			getdays: function(next) {
				return moment.unix(next).format("YYYY-MM-DD HH:mm:ss")
			}
		},
		methods: {
			getdata() {
				var that = this;
				that.page = 1
				withdrawlist({
					page: that.page
				}, {
					custom: {
						auth: true
					}
				}).then(res => {
					if (res.code == 1) {
						that.list = res.data
					}
				}).catch(err => {

				})
			},
			getmore() {
				var that = this;
				that.page = that.page + 1;
				withdrawlist({
					page: that.page
				}, {
					custom: {
						auth: true
					}
				}).then(res => {
					if (res.code == 1) {
						console.log(res.data)
						var data = res.data;
						for (var i = 0; i < data.length; i++) {
							that.list.push(data[i]);
						}
					}
				}).catch(err => {

				})
			},
		}
	};
</script>


<style scoped lang="scss">
	.page {
		background-color: rgb(255, 255, 255);
		width: 100%;
		height: 100%;

		.group_5 {
			padding: 36rpx 22rpx 611rpx 23rpx;
			flex: 1 1 auto;
			overflow-y: auto;

		}
	}

	.top-section {
		padding: 35rpx 11rpx 40rpx;
		background-color: rgb(242, 242, 242);
		border-radius: 10rpx;
		width: 690rpx;
		margin: 0rpx auto;
		margin-top: 16rpx;

		.text_6 {
			color: rgb(36, 35, 35);
			font-size: 26rpx;
			line-height: 25rpx;
			white-space: nowrap;
		}

		.text_8 {
			margin-top: 29rpx;
			color: rgb(36, 35, 35);
			font-size: 26rpx;
			line-height: 24rpx;
			white-space: nowrap;
		}

		.bottom-group {
			margin-top: 28rpx;
			line-height: 26rpx;
			white-space: nowrap;

			.text_10 {
				color: rgb(36, 35, 35);
				font-size: 26rpx;
				line-height: 25rpx;
			}

			.text_12 {
				color: rgb(255, 180, 0);
				font-size: 26rpx;
				line-height: 26rpx;
			}
		}
	}

	.view_2 {
		margin-top: 16rpx;
	}
</style>
